﻿using System;
using System.Collections.Generic;
using System.Diagnostics;

using NetStsAdm;

namespace NetStsAdm.Commands
{
    /// <summary>
    /// Commands used to edit configuration file. It fetchs the app.config filepath and opens it up in notpad.
    /// </summary>
    internal class ConfigCommand : ICommand
    {
        public int Execute(Dictionary<string, string> keyValues, out string Output)
        {
            Output = "";
            openConfig();
            return 0;
        }

        void openConfig()
        {
            ProcessStartInfo psi = new ProcessStartInfo("notepad.exe");
            Config cfg = Config.GetConfig();            
            psi.Arguments = cfg.ConfigPath;
            Process p = new Process();
            p.StartInfo = psi;
            p.Start();
        }
    }
}
